package com.course.domain.vo;

import com.course.domain.pojo.CourseDetail;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class CourseOutlineVo {
    private Long value; // 课程id
    private String label;   // 课程标题
    private List<CourseOutlineVo> children;    // 子课程

    public static CourseOutlineVo createCourseDetailsDto(CourseDetail details) {
        return new CourseOutlineVo(details.getId(), details.getTitle(), new ArrayList<>());
    }
}
